package vip.xiaonuo.smzq.modular.lifecycle.po.datamanager;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.lang.Dict;
import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import vip.xiaonuo.smzq.modular.lifecycle.entity.LifeCycleMineStore;
import vip.xiaonuo.smzq.modular.lifecycle.entity.LifeCycleMineralMea;
import vip.xiaonuo.smzq.modular.lifecycle.entity.LifeCyclePedigee;

import java.util.List;

/**
 * 查询矿山信息参数实体
 * @auter GEOSCENE_于彦飞
 * @date 2024/02/20
 */
@Data
public class SaveOrUpdateLCMeaPO extends LifeCycleMineralMea {

    @ApiModelProperty("前端选的矿石类型")
    private List<String> mineralTypes;
//    private List<Integer> mineralTypes;

    /**
     * 得到矿石类型参数
     * @return
     */
    public void initCb06Only(){
        String val = CollUtil.getLast(mineralTypes);

        List<String> vals = StrUtil.split(val,"_");

        String kcdm = CollUtil.get(vals,0);
        String tjdx = CollUtil.get(vals,1);
        tjdx = StrUtil.equals(tjdx,"统计对象")?null:tjdx;
        String kclb = CollUtil.get(vals,2);
        kclb = StrUtil.equals(kclb,"矿产类别")?null:kclb;
        super.setMineralType(Convert.toInt(kcdm));
        super.setTjdx(Convert.toInt(tjdx));
        super.setKclb(kclb);
    }



}
